<template>
  <div class="home-container">
    <!-- 导航栏 -->
    <nav class="navbar">
      <div class="logo">租房信息分析系统</div>
      <div class="nav-buttons">
        <button class="nav-button" @click="goToLogin">登录</button>
        <button class="nav-button" @click="goToRegister">注册</button>
      </div>
    </nav>

    <!-- 英雄区域 -->
    <div class="hero-section">
      <h1 class="hero-title">欢迎使用租房信息分析系统</h1>
      <p class="hero-subtitle">一站式租房市场数据分析平台</p>
      <div class="hero-image">
        <img src="https://picsum.photos/id/1048/800/400" alt="租房市场分析" />
      </div>
    </div>

    <!-- 数据统计模块 -->
    <div class="stats-section">
      <div class="stat-card">
        <div class="stat-icon">🏠</div>
        <div class="stat-value">10,000+</div>
        <div class="stat-label">实时房源</div>
      </div>
      <div class="stat-card">
        <div class="stat-icon">📈</div>
        <div class="stat-value">98%</div>
        <div class="stat-label">数据准确率</div>
      </div>
      <div class="stat-card">
        <div class="stat-icon">🌆</div>
        <div class="stat-value">50+</div>
        <div class="stat-label">城市覆盖</div>
      </div>
    </div>

    <!-- 功能特点模块 -->
    <div class="features-section">
      <h2 class="section-title">我们的优势</h2>
      <div class="feature-grid">
        <div class="feature-card">
          <div class="feature-icon">🔍</div>
          <h3 class="feature-title">智能搜索</h3>
          <p class="feature-desc">支持多条件组合查询，精准匹配理想房源</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">📊</div>
          <h3 class="feature-title">季度趋势分析</h3>
          <p class="feature-desc">提供可视化数据图表，掌握价格走势</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">🗺️</div>
          <h3 class="feature-title">区域对比排名</h3>
          <p class="feature-desc">一键查看不同区域房价差异与性价比</p>
        </div>
        <div class="feature-card">
          <div class="feature-icon">⏱️</div>
          <h3 class="feature-title">历史记录追踪</h3>
          <p class="feature-desc">自动保存您的搜索记录，方便再次查看</p>
        </div>
      </div>
    </div>

    <!-- 底部 -->
    <footer class="footer">
      <p>© 2025 租房信息分析系统 · 所有数据来源于真实房源</p>
    </footer>
  </div>
</template>
<script>
export default {
  name: 'HomeView',
  methods: {
    goToLogin() {
      console.log('跳转到登录页');
      this.$router.push({ name: 'login' });
    },
    goToRegister() {
      console.log('跳转到注册页');
      this.$router.push({ name: 'login', query: { mode: 'register' } });
    } // 这里添加逗号
  }
}
</script>


<style scoped>
.home-container {
  min-height: 100vh;
  background-color: #f5f7fa;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 导航栏 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #3498db;
}

.nav-buttons {
  display: flex;
  gap: 1rem;
}

.nav-button {
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  color: #3498db;
  border: 1px solid #3498db;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-button:hover {
  background-color: #3498db;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 英雄区域 */
.hero-section {
  text-align: center;
  margin: 4rem 0;
  max-width: 1200px;
  padding: 0 2rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #7f8c8d;
  margin-bottom: 2rem;
}

.hero-image {
  margin-top: 2rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.hero-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* 统计模块 */
.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.stat-card {
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 2.5rem;
  color: #3498db;
  margin-bottom: 1rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #7f8c8d;
  font-size: 1.1rem;
}

/* 功能特点模块 */
.section-title {
  text-align: center;
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.feature-card {
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  color: #3498db;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.3rem;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.feature-desc {
  color: #7f8c8d;
  font-size: 1rem;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  background-color: #ecf0f1;
  color: #7f8c8d;
  font-size: 0.9rem;
}
</style>
